package com.googlecode.kipler.container.dl;

import java.util.Iterator;

import com.googlecode.kipler.syntax.concept.Concept;
import com.googlecode.kipler.syntax.concept.Nominal;


/**
 * 
 * @author İnanç Seylan
 *
 */
public class SHOIQIndividual extends Individual {
	private static final int UNKNOWN = Integer.MAX_VALUE;

	private int level;

	public SHOIQIndividual() {
		super();
		level = UNKNOWN;
	}

	public SHOIQIndividual(String name) {
		super(name);
		level = UNKNOWN;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public boolean isNominal() {
		boolean found = false;
		for (Iterator<Concept> i = conceptIterator(ConceptCategory.NOMINAL); i
				.hasNext()
				&& !found;) {
			Nominal nominal = (Nominal) i.next();
			found = !nominal.isNegated();
		}
		return found;
	}

	@Override
	public SHOIQIndividual copy() {
		SHOIQIndividual result = new SHOIQIndividual();
		result.name = name;
		result.categorizer = categorizer.copy();
		result.level = level;
		return result;
	}
}
